
export const GET_LOGGED_USER = 'GET_LOGGED_USER';
export const SET_LOGGED_USER = 'SET_LOGGED_USER';

export const getLoggedUser = () => (dispatch) => {
    return dispatch({ type: GET_LOGGED_USER });
};

export const login = () => (dispatch) => {
    return Promise.resolve(dispatch({ 
        type: SET_LOGGED_USER, 
        logged: true
    }));
};

export const logout = () => dispatch => {
    return dispatch({
        type: SET_LOGGED_USER,
        logged: false
    });
};

export const type = {
    GET_LOGGED_USER,
    SET_LOGGED_USER
};
